﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageLayout.Master" AutoEventWireup="true" CodeBehind="frmDiemTS.aspx.cs" Inherits="BVVD_Website.ql_thi_sinh.frmDiemTS" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        div.RadListBox .rlbGroup {
            overflow: auto;
        }

        .rsbHeader ul,
        .rsbListItem ul {
            margin: 0;
            padding: 0;
            width: 100%;
            display: inline-block;
            list-style-type: none;
        }

        .rsbHeader ul {
            padding-left: 5px;
        }

        .col1,
        .col2,
        .col3 {
            margin: 0;
            padding: 0 5px 0 0;
            width: 110px;
            line-height: 14px;
            float: left;
        }


        html .rsbSlide,
        html .rsbDropDownSlide {
            z-index: 90002;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">
    <div id="Div1" class="mpBottomContent" runat="server">
        <asp:Label runat="server" ID="lblMenu" Style="margin: 0 auto 0 auto; font-family: 'Microsoft Sans Serif'; font-size: larger; color: forestgreen" Text="NHẬP ĐIỂM THI THÍ SINH"></asp:Label>

        <table style="margin: 0 auto 0 auto; border: 5px thin red; width: 90% !important; padding: 5px 5px 5px 5px">
            <caption style="float: left">
                <telerik:RadDropDownList DefaultMessage="Chọn kỳ thi" DropDownHeight="200" Skin="Hay" OnSelectedIndexChanged="ddlKythi_SelectedIndexChanged" AutoPostBack="true" runat="server" ID="ddlKythi"></telerik:RadDropDownList>
                <telerik:RadDropDownList DefaultMessage="Chọn phòng thi" DropDownHeight="200" Skin="Hay" OnSelectedIndexChanged="ddlPhongthi_SelectedIndexChanged" AutoPostBack="true" runat="server" ID="ddlPhongthi"></telerik:RadDropDownList>
                <telerik:RadDropDownList DefaultMessage="Chọn môn thi" DropDownHeight="200" Skin="Hay" OnSelectedIndexChanged="ddlMonthi_SelectedIndexChanged" AutoPostBack="true" runat="server" ID="ddlMonthi"></telerik:RadDropDownList>
            </caption>
            <tr>
                <td>
                    <telerik:RadGrid ID="grvDiemthiTS" Skin="Hay" AllowFilteringByColumn="true" MasterTableView-NoMasterRecordsText="Không tìm thấy bản ghi nào" MasterTableView-ShowHeadersWhenNoRecords="true" ClientSettings-ColumnsReorderMethod="Reorder" ClientSettings-AllowColumnsReorder="true" ClientSettings-Animation-AllowColumnReorderAnimation="true" ClientSettings-Animation-ColumnReorderAnimationDuration="300" PageSize="15" AllowSorting="true" AutoGenerateColumns="false" AllowPaging="false" ClientSettings-AllowDragToGroup="true" runat="server" OnItemDataBound="grvDiemthiTS_ItemDataBound" OnNeedDataSource="grvDiemthiTS_NeedDataSource"   OnItemCommand="grvDiemthiTS_ItemCommand" >

                        <PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="RadComboBox" Wrap="true" AlwaysVisible="true" />

                        <MasterTableView CommandItemDisplay="TopAndBottom" EnableNoRecordsTemplate="true" CssClass="MasterClass" ShowFooter="true" EditMode="PopUp" Summary="SUMMARY" ShowHeadersWhenNoRecords="true"
                            DataKeyNames="RECID">
                            <CommandItemSettings ExportToPdfText="Xuất file dạng PDF" ShowExportToPdfButton="true"></CommandItemSettings>
                            <CommandItemSettings ExportToExcelText="XUất file dạng Excel" ShowExportToExcelButton="true"></CommandItemSettings>

                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                            <CommandItemTemplate>
                                <div style="padding: 5px 5px; float: right">

                                    <telerik:RadButton ButtonType="LinkButton" BorderStyle="None" Skin="Metro" Text="Lưu điểm" runat="server" ID="lbtnSave" Visible="true" CommandName="ChamDiem">
                                        <Icon PrimaryIconCssClass="rbSave" PrimaryIconLeft="4" PrimaryIconRight="4" />
                                    </telerik:RadButton>
                                    &nbsp;&nbsp; 
                                    <%--<telerik:RadButton ID="LinkButton2" Skin="Telerik" ButtonType="StandardButton" runat="server" CommandName="InitInsert" Text="Thêm mới" Visible='<%# !grvDiemthi.MasterTableView.IsItemInserted %>'></telerik:RadButton>&nbsp;&nbsp;   --%>
                                    <telerik:RadButton ID="LinkButton4" Skin="Metro" BorderStyle="None" ButtonType="LinkButton" runat="server" CommandName="RebindGrid" Text="Làm mới danh sách">
                                        <Icon PrimaryIconCssClass="rbRefresh" PrimaryIconLeft="4" PrimaryIconRight="4" />
                                    </telerik:RadButton>
                                </div>
                            </CommandItemTemplate>



                            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
                            <NoRecordsTemplate>
                                <div>
                                    Không có bản ghi nào
                                </div>
                            </NoRecordsTemplate>
                            <Columns>

                                <telerik:GridBoundColumn UniqueName="RECID" EditFormColumnIndex="1" Display="false" ReadOnly="true" HeaderText="" DataField="RECID">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                    <HeaderStyle ForeColor="Silver" Width="20px"></HeaderStyle>
                                    <ItemStyle ForeColor="Gray"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MAKT" ItemStyle-HorizontalAlign="Left" Display="false" FilterControlWidth="70%" AllowFiltering="false" HeaderStyle-Width="20%" HeaderText="Mã kỳ thi" DataField="MAKT">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TENKT" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" AllowFiltering="false" HeaderStyle-Width="10%" HeaderText="Kỳ thi" DataField="TENKT">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MAPT" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" Display="false" AllowFiltering="false" HeaderStyle-Width="20%" HeaderText="Mã phòng thi" DataField="MAPT">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TENPT" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" AllowFiltering="false" HeaderStyle-Width="15%" HeaderText="Tên phòng thi" DataField="TENPT">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="SOBAODANH" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Số báo danh" DataField="SOBAODANH">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TENHV" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Họ tên thí sinh" DataField="TENHV">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MAMT" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" Display="false" AllowFiltering="false" HeaderStyle-Width="20%" HeaderText="Mã môn thi" DataField="MAMT">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TENMT" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" AllowFiltering="false" HeaderStyle-Width="15%" HeaderText="Môn thi" DataField="TENMT">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridTemplateColumn UniqueName="DIEM" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataType="System.Decimal" AllowFiltering="false" FilterControlWidth="70%" ItemStyle-Width="70%" HeaderStyle-Width="15%" HeaderText="Điểm" DataField="DIEM">
                                    <ItemTemplate>
                                        <telerik:RadNumericTextBox runat="server" ID="txtDIEM" ShowSpinButtons="true" MinValue="0" MaxValue="10" NumberFormat-DecimalDigits="2" Width="60%" Text='<%# DataBinder.Eval(Container.DataItem,"DIEM") %>'></telerik:RadNumericTextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>

                                <%--<telerik:GridTemplateColumn UniqueName="LANTHI" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" DataType="System.Int32" FilterControlWidth="70%" HeaderStyle-Width="15%" HeaderText="Lần thi" DataField="LANTHI">
                                    <ItemTemplate>
                                        <telerik:RadNumericTextBox runat="server" ID="txtLANTHI" ShowSpinButtons="true" MinValue="0" MaxValue="10" NumberFormat-DecimalDigits="0" Width="70%" Text='<%# DataBinder.Eval(Container.DataItem,"LANTHI") %>'></telerik:RadNumericTextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>--%>



                                <telerik:GridTemplateColumn UniqueName="TRANGTHAI"  ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" Display="false" HeaderStyle-Width="15%" HeaderText="Trạng thái" DataField="TRANGTHAI">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblTRANGTHAI" Text='<%# DataBinder.Eval(Container.DataItem,"TRANGTHAI")!=null?DataBinder.Eval(Container.DataItem,"TRANGTHAI").ToString().Equals("1")?"ACTIVE":"CLOSED" :"" %>'>                                            
                                        </asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>


                                <telerik:GridBoundColumn UniqueName="GHICHU" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" AllowFiltering="false" Display="false" HeaderStyle-Width="30%" HeaderText="Ghi chú" DataField="GHICHU">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <%--<telerik:GridEditCommandColumn EditText="Sửa" ButtonType="ImageButton" ItemStyle-Width="30" HeaderText="Sửa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="30">
                                </telerik:GridEditCommandColumn>
                                <telerik:GridButtonColumn CommandName="Delete" Display="false" ButtonType="ImageButton" HeaderText="Xóa" ItemStyle-Width="60" HeaderStyle-Width="60" ConfirmDialogType="RadWindow" ConfirmTextFormatString="Bạn chắc chắn muốn xóa bản ghi : \n\n Lớp học : {0} <br>\t Môn học : {1} <br> \n\t Học viên :  {2} \n " ConfirmTextFields="TENLH,TENMH, TENHV" ConfirmTitle="Xác nhận xóa" ConfirmText="Xóa, Hủy" Text="Xóa" UniqueName="btnDelete">
                                </telerik:GridButtonColumn>--%>
                            </Columns>
                            <EditFormSettings EditFormType="Template" PopUpSettings-ScrollBars="None" PopUpSettings-ShowCaptionInEditForm="true" PopUpSettings-Width="600" PopUpSettings-ZIndex="4000" InsertCaption="Nhập điểm cho học viên " PopUpSettings-Modal="true" CaptionFormatString="Học viên {0}" CaptionDataField="TENHV">
                                <FormTemplate>

                                    <div id="rfd-demo-zone" style="border: solid; border-color: whitesmoke; border-width: 5px; padding: 6px 6px 6px 6px;">

                                        <table width="600" style="text-align: left; overflow: no-display" border="0" cellspacing="5" cellpadding="5">
                                            <caption style="color: green; font-weight: bold">
                                                ĐIỂM THI
                                            </caption>
                                            <tr>
                                                <td>
                                                    <table style="width: 100%; height: 180px;">
                                                        <tr>
                                                            <td>Lớp học</td>
                                                            <td>
                                                                <asp:Label runat="server" Style="color: green; font-weight: bold" Skin="Telerik" Text='<%# Bind("TENLH")  %>' ID="lblTENLH"></asp:Label>
                                                                <telerik:RadTextBox runat="server" Display="false" Skin="Telerik" Text='<%# Bind("MALH")  %>' ID="txtMALH"></telerik:RadTextBox>

                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Môn học</td>
                                                            <td>
                                                                <asp:Label runat="server" Style="color: green; font-weight: bold" Skin="Telerik" Text='<%# Bind("TENMH")  %>' ID="lblTENMH"></asp:Label>
                                                                <telerik:RadTextBox runat="server" Display="false" Skin="Telerik" Text='<%# Bind("MAMH")  %>' ID="txtMAMH"></telerik:RadTextBox>

                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <td>Học viên</td>
                                                            <td>
                                                                <%--<telerik:RadTextBox runat="server" Skin="Telerik" Text='<%# Bind("MAHV")  %>' ID="txtMAHV"></telerik:RadTextBox>--%>
                                                                <telerik:RadDropDownList runat="server" DropDownHeight="200" Skin="Telerik" DefaultMessage="Chọn" ID="ddlMAHV"></telerik:RadDropDownList>
                                                                <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="Dynamic" runat="server" EnableViewState="true" ControlToValidate="ddlMAHV" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </asp:RequiredFieldValidator>--%>
                                                            </td>
                                                        </tr>

                                                        <tr>
                                                            <td>Ngày thi </td>
                                                            <td>
                                                                <telerik:RadDatePicker Skin="Telerik" DateInput-DisplayDateFormat="dd/MM/yyyy" runat="server" ID="rdpNGAYTHI1" DbSelectedDate='<%# Bind("NGAYTHI") %>'></telerik:RadDatePicker>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" Display="Dynamic" runat="server" ControlToValidate="rdpNGAYTHI1" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td>
                                                    <table style="width: 100%; height: 180px;">
                                                        <tr>
                                                            <td>Điểm </td>
                                                            <td>
                                                                <telerik:RadNumericTextBox runat="server" Skin="Telerik" ShowSpinButtons="true" MinValue="0" MaxValue="10" NumberFormat-DecimalDigits="2" DbValue='<%# Bind("DIEM")  %>' ID="txtDIEM"></telerik:RadNumericTextBox>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Display="Dynamic" runat="server" ControlToValidate="txtDIEM" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Lần thi</td>
                                                            <td>
                                                                <telerik:RadNumericTextBox runat="server" ShowSpinButtons="true" MinValue="0" MaxValue="10" Skin="Telerik" NumberFormat-DecimalDigits="0" DbValue='<%# Bind("LANTHI")  %>' ID="txtLANTHI"></telerik:RadNumericTextBox>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" Display="Dynamic" runat="server" ControlToValidate="txtLANTHI" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>


                                                        <tr>
                                                            <td>Trạng thái</td>
                                                            <td style="padding-left: 1px">
                                                                <asp:RadioButtonList runat="server" ID="rblTRANGTHAI" CellPadding="10" RepeatDirection="Horizontal">
                                                                    <asp:ListItem Text="Mở" Value="1" Selected="True"></asp:ListItem>
                                                                    <asp:ListItem Text="Đóng" Value="0"></asp:ListItem>
                                                                </asp:RadioButtonList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Ghi chú</td>
                                                            <td>
                                                                <telerik:RadTextBox runat="server" ID="txtGHICHU" Skin="Telerik" TextMode="MultiLine" Text='<%# Bind("GHICHU")  %>'></telerik:RadTextBox></td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <asp:LinkButton ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Thêm mới" : "Cập nhật" %>'
                                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:LinkButton>&nbsp;
                                <asp:LinkButton ID="btnCancel" Text="Hủy" runat="server" CausesValidation="False"
                                    CommandName="Cancel"></asp:LinkButton></td>
                                            </tr>
                                        </table>
                                    </div>

                                </FormTemplate>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings>
                            <ClientEvents OnPopUpShowing="PopUpShowing" />
                            <ClientEvents OnRowDblClick="RowDblClick" />
                            <Selecting AllowRowSelect="true" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                            <Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="500" />

                        </ClientSettings>
                        <ExportSettings Excel-Format="Biff" Pdf-DefaultFontFamily="Arial" FileName="Mydata" IgnorePaging="false" Excel-AutoFitImages="true" Excel-FileExtension="xls" HideStructureColumns="true"></ExportSettings>
                    </telerik:RadGrid>
                </td>
            </tr>
        </table>
    </div>

    <telerik:RadNotification ID="rnAlert" ContentScrolling="Auto" runat="server" Width="300" Position="TopRight" EnableRoundedCorners="true"
        EnableShadow="true" Skin="Hay" Overlay="true" Animation="Fade" AnimationDuration="1000" Title="Thông báo">
    </telerik:RadNotification>
    
</asp:Content>
